package com.qingxin.sys.support;


/**
 * 登录信息解析程序，登录时将用户名和密码以36进制编码为字符串,
 * 用户名包括0-9A-Za-z，密码为任意字符串
 * @author Administrator
 *
 */
public class QxLogin {
	
	private String loginname;
	private String passwd;
	
	public QxLogin(String qxlogin) {
		char[] info = qxlogin.toCharArray();
		StringBuilder buf = new StringBuilder();
		for(int i=0, n=info.length; i<n; i++){
			char ch = info[i];
			if(ch == 'd'){
				loginname = buf.toString();
				buf.setLength(0);
				continue;
			}
			if(ch >= 'w'){
				buf.append((char)Integer.parseInt(""+ch, 36));
				continue;
			}
			buf.append((char)Integer.parseInt(ch+""+info[i+1], 36));
			i++;
		}
		passwd = buf.toString();
	}

	
	public String getLoginname() {
		return loginname;
	}

	public String getPasswd() {
		return passwd;
	}
	
	
}
